package com.demo.core.io;

import com.demo.core.Constants;

import java.io.*;

public class TxtReader {

    BufferedReader br = null;

    public TxtReader(String srcfile) throws IOException {
        br = new BufferedReader(new InputStreamReader(new FileInputStream(
                srcfile), Constants.ENCODE_UTF8));
    }

    public TxtReader(File srcfile) throws IOException {
        br = new BufferedReader(new InputStreamReader(new FileInputStream(
                srcfile), Constants.ENCODE_UTF8));
    }

    public String readLine() throws IOException {
        return br.readLine();
    }

    public void close() throws IOException {
        br.close();
    }
}
